:root {
  --color-btn-text: #24292f;
  --color-btn-bg: #f6f8fa;
  --color-btn-border: rgba(27, 31, 36, 0.15);
  --color-btn-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
  --color-btn-inset-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --color-btn-hover-bg: #f3f4f6;
  --color-btn-hover-border: rgba(27, 31, 36, 0.15);
  --color-btn-focus-border: rgba(27, 31, 36, 0.15);
  --color-btn-focus-shadow: 0 0 0 2px #abadaf4d;
}

div[data-controll-panel-container],
div[data-controll-panel-container-modal] {
  z-index: 20;
  position: relative;
  overflow: hidden;
  min-height: 200px;

  .fg-none {
    display: none !important;
  }

  .fg-success {
    color: #1a7f37;
  }

  img[alt="uml diagram"] {
    width: 45%;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 6px;
  }

  .mermaid,.diagram-m {
    svg {
      margin: 20px auto;
    }
  }
}

.fg-show {
  display: flex !important;
}

div[data-control-panel] {
  [data-control-btn] {
    color: var(--color-btn-text);
    background-color: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
    transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    transition-property: color, background-color, border-color;
    position: relative;
    display: inline-block;
    padding: 5px 7px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid;
    border-color: var(--color-btn-border);
    border-radius: 6px;
    appearance: none;

    &:focus {
      border-color: var(--color-btn-focus-border);
      outline: none;
      box-shadow: var(--color-btn-focus-shadow);
    }

    &:hover {
      background-color: var(--color-btn-hover-bg);
      border-color: var(--color-btn-hover-border);
      transition-duration: 0.1s;
    }
  }

  button {
    padding: 5px 7px;
  }

  [data-control-btn="zoom-in"] {
    grid-column: 3;
    grid-row: 1;
  }

  [data-control-btn="zoom-out"] {
    grid-column: 3;
    grid-row: 3;
  }

  [data-control-btn="reset"] {
    grid-column: 2;
    grid-row: 2;
  }

  [data-control-btn="up"] {
    grid-column: 2;
    grid-row: 1;
  }

  [data-control-btn="down"] {
    grid-column: 2;
    grid-row: 3;
  }

  [data-control-btn="left"] {
    grid-column: 1;
    grid-row: 2;
  }

  [data-control-btn="right"] {
    grid-column: 3;
    grid-row: 2;
  }
}

div[data-control-panel="view"] {
  position: absolute;
  bottom: 1em;
  right: 1em;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.2em;
}

div[data-control-panel="details"] {
  position: absolute;
  top: 1em;
  right: 1em;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2em;

  [data-control-btn="download"]{
    grid-column: 2;
    grid-row: 2;
  }
}



[data-diagram-modal] {
  display: none;
  position: fixed;
  z-index: 97;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  justify-content: center;
  align-items: center;


  .modal-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(7px);
    width: 100%;
    height: 100%;
    z-index: -1;
  }

  /* Modal Content */
  .modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    max-width: 80%;
    min-width: 60%;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 0.4s;
    animation-name: animatetop;
    animation-duration: 0.4s;
    border-radius: 5px;
    max-height: 90%;
    overflow: auto;
  }

  /* The Close Button */
  .close {
    color: #000000;
    float: right;
    font-size: 18px;
    font-weight: bold;

    &:hover,
    &:focus {
      transform: scale(1.2);
      text-decoration: none;
      cursor: pointer;
    }
  }

  .modal-header {
    padding: 2px 16px;
    background-color: #434e552e;
    color: #000000;
  }

  .modal-body {
    padding: 2px 16px;
    margin: 20px 2px
  }
}

/* Add Animation */
@-webkit-keyframes animatetop {
  from {
    top: -300px;
    opacity: 0
  }

  to {
    top: 0;
    opacity: 1
  }
}

@keyframes animatetop {
  from {
    top: -300px;
    opacity: 0
  }

  to {
    top: 0;
    opacity: 1
  }
}